package mt.omid.jscap;

/****
 * Create by Omid Mehdizadeh
 * Copyright 2010, Omid Mehdizadeh
 * Based on JDiameter Open Source Project
 */

import java.net.URISyntaxException;
import java.net.UnknownServiceException;

import org.jdiameter.api.Configuration;
import org.jdiameter.api.InternalException;
import org.jdiameter.api.MetaData;
import org.jdiameter.api.Peer;
import org.jdiameter.api.URI;
import org.jdiameter.client.api.IMetaData;
import org.jdiameter.client.api.controller.IPeerTable;
import org.jdiameter.client.api.fsm.IFsmFactory;
import org.jdiameter.client.api.io.IConnection;
import org.jdiameter.client.api.io.ITransportLayerFactory;
import org.jdiameter.client.api.io.TransportException;
import org.jdiameter.client.api.parser.IMessageParser;
import org.jdiameter.client.api.router.IRouter;
import org.jdiameter.client.impl.controller.PeerImpl;
import org.jdiameter.client.impl.controller.PeerTableImpl;
import org.jdiameter.common.api.concurrent.IConcurrentFactory;
import org.jdiameter.common.api.statistic.IStatisticFactory;


public class PeerManager extends PeerTableImpl
{

    protected PeerManager()
    {
	super();
    }

    public PeerManager( Configuration paramConfiguration, MetaData paramMetaData,
			IRouter paramIRouter, IFsmFactory paramIFsmFactory,
			ITransportLayerFactory paramITransportLayerFactory,
			IStatisticFactory paramIStatisticFactory,
			IConcurrentFactory paramIConcurrentFactory,
			IMessageParser paramIMessageParser )
    {
	super( paramConfiguration, paramMetaData, paramIRouter, paramIFsmFactory,
		paramITransportLayerFactory, paramIStatisticFactory, paramIConcurrentFactory,
		paramIMessageParser );
    }

    protected Peer createPeer( int paramInt, String paramString1, String paramString2,
			       String paramString3, MetaData paramMetaData,
			       Configuration paramConfiguration1,
			       Configuration paramConfiguration2, IFsmFactory paramIFsmFactory,
			       ITransportLayerFactory paramITransportLayerFactory,
			       IStatisticFactory paramIStatisticFactory,
			       IConcurrentFactory paramIConcurrentFactory,
			       IMessageParser paramIMessageParser ) throws InternalException,
	    TransportException, URISyntaxException, UnknownServiceException
    {
	return new SCAPPeerImpl( this, paramInt, new URI( paramString1 ), paramString2,
		paramString3, ( IMetaData ) paramMetaData.unwrap( IMetaData.class ),
		paramConfiguration1, paramConfiguration2, paramIFsmFactory,
		paramITransportLayerFactory, paramIStatisticFactory, paramIConcurrentFactory,
		paramIMessageParser );
    }

}
